package com.dragons.spring5.beans;

/**员工类*/
public class Emp {
    private String ename;
    private String gender;
    private Dept dept;/**员工属于某个部门，用对象属性表示*/
    public void setEname(String ename) { this.ename = ename; }
    public void setGender(String gender) { this.gender = gender; }
    public void setDept(Dept dept) { this.dept = dept; }

    /**第二种级联赋值的方式  需要  get方法*/
    public Dept getDept() { return dept; }


    @Override
    public String toString() {
        return "Emp{" + "ename='" + ename + '\'' +
                ", gender='" + gender + '\'' + ", dept=" + dept + '}';
    }
}

